  <div class="row">
    <div class="col-sm-12">
      <form id="indexModulesform" action="<?php echo U('Analysis/indexModule');?>">
        <input type="hidden" name="show" value="position">
        <input type="hidden" name="pos_id" value="<?php echo $_GET['pos_id'];?>">
      </form>
      <div id="indexModules"> </div>
    </div>
    <div class="col-sm-12">
      <section class="panel timeajaxpanel">
        <div class="panel-body" style="padding-left:0;padding-right:0; height:260px;">
          <div style="padding-right:15px;">
            <div class="btn-group pull-right">
              <button class="btn btn-default"  value="week">本周</button>
              <button class="btn btn-default"  value="month">本月</button>
              <button class="btn btn-default"  value="year">今年</button>
            </div>
              <select class="form-control pull-right integraltype1" name="integraltype" style="display:inline; margin-right:5px; width:auto;">
                  <volist name="integraltype" id="it">
                      <option value="<?php echo $it['id'];?>"><?php echo $it['remark'];?></option>
                  </volist>
              </select>
              <select class="form-control pull-right io" name="io" style="display:inline; margin-right:5px; width:auto;">
                  <option value="1">奖分</option>
                  <option value="-1">扣分</option>
              </select>
          </div> 
          <form action="<?php echo U('Unit/chart');?>" id="timeajaxform" method="post">
            <!--pid优先,mid其次,两者皆空则找第一个部门id-->
            <input type="hidden" name="pid" value="<?php echo $_GET['pos_id'];?>">
            <input type="hidden" name="mid" value="">
            <input type="hidden" name="time" value="">
            <input type="hidden" name="integraltype" value="">
            <input type="hidden" name="io" value="">
          </form>
          <div id="timeajax" style="padding-top:0px;"> 
            <!--此处post引入图表--> 
            
          </div>
        </div>
      </section>
      <script>
    $('#timeajax').ajaxlist();
    $('.timeajaxpanel .btn').each(function(){
        $(this).click(function(){
            $('#timeajaxform input[name="time"]').val($(this).attr('value'));
            $('#timeajaxform').submit();
        });
    });
    $('.io').change(function(){
        $('#timeajaxform input[name="io"]').val($(this).val());
        $('#timeajaxform').submit();
    });
    $('.integraltype1').change(function(){
        $('#timeajaxform input[name="integraltype"]').val($(this).val());
        $('#timeajaxform').submit();
    });
	$('#indexModules').ajaxlist();
</script> 
    </div>
  </div>
  <section class="panel">
    <header class="panel-heading"> <?php echo $positionname;?>奖扣分比例
      <div class="btn-group pull-right">
        <form id="lineChartform" action="{:U('ChartsAnalysis/area')}">
          <?php if(isset($_GET['pos_id'])){?>
          <input type="hidden" name="memberpositionid" value="<?php echo $_GET['pos_id'];?>">
          <?php }?>
          <input type="hidden" name="chartType" class="chartType" value="week"/>
          <div class="btn-group pull-right"><button class="btn btn-default btn-chart btn-success" type="button" form="lineChartform" value="week" name="chartType">本周</button><button class="btn btn-default btn-chart" type="button" form="lineChartform" value="month" name="chartType">本月</button>
            <button class="btn btn-default btn-chart" type="button" form="lineChartform" value="year" name="chartType">今年</button>
            
            
          </div>
          <select class="form-control pull-right integraltype2" name="integralType" style="display:inline; margin-right:5px; width:auto;">
            <volist name="integraltype" id="it">
              <option value="<?php echo $it['typename'];?>"><?php echo $it['remark'];?></option>
            </volist>
          </select>
        </form>
      </div>
      <div class="clearfix"></div>
    </header>
    <div class="panel-body">
      <div class="chartJS" >
        <div class="pull-right">
          <div class="btn-group">
            <div class="btn btn-warning"> <i class="fa icon-thumbs-up"></i> 奖扣次数 <span class="numCount"> 加载中……
             </span> </div>
          </div>
          <div class="btn-group"> 
            <div class="btn btn-warning"> <i class="fa icon-thumbs-up"></i> 奖扣分数 <span class="numSum"> 加载中…… </span> </div>
          </div>
        </div>
        <canvas  height="250" width="700" id="line-Chart"></canvas>
        <div id="lineChart">
          <div>
            <div></div>
          </div>
        </div>
      </div>
    </div>
  </section>
  
  
  


<div class="row">






  <div class="col-sm-12">



<div style=" width:100%;">


  


<div class="panel" style="box-shadow:none; position:relative;">













            
<div class="panel botpanel" style="box-shadow:none;" data-step="1" data-position="left" >
                <header class="panel-heading" style="font-weight:normal; "> 
                
                
                
                
                <form id="rankingform" action="<?php echo U('Analysis/department');?>"> 
                
                
                
                <input type="hidden" name="pos_id" value="<?php echo $_GET['pos_id'];?>">
                
                <div class="btn-group pull-right">
              <button class="btn btn-default" onClick="$('.timeh').val('week');" value="week">本周</button>
              <button class="btn btn-default" onClick="$('.timeh').val('month');" value="month">本月</button>
              <button class="btn btn-default" onClick="$('.timeh').val('year');" value="year">今年</button>
            </div>
            
            
            
            <if condition="count($integraltype) gt 1">
            
            <select class="form-control pull-right integraltype1" onChange="$('#integral_type1').val('<?php echo $it['id'];?>'); $('#rankingform').submit();" name="integraltype" style="display:inline; margin-right:5px; width:auto;">
              <volist name="integraltype" id="it">
                <option value="<?php echo $it['id'];?>"><?php echo $it['remark'];?></option>
              </volist>
            </select>
            
            <else/>
            
            <input type="hidden" id="integral_type1" name="integral_type" value="{$integraltype.0.id}">
            
            </if>
                
                
                
                
                <input type="hidden" class="timeh" name="time" value="week">
                <div class="pull-right" style="margin-right:15px;"><html:dropdownselect class="typeselect" selected="" name="type" style="height:auto; width:auto; display:inline-block;" multi="1" action="{:U('Team/form')}" title="选择规则"  placeholder="点击选择类型"  />
                    
                    
                 
                                            <!--<input class="form-control datepicker" onChange="$('#rankingform').submit();" id="starttime" name="starttime" readonly style="cursor:pointer; width:100px; display:inline;height:35px" value="<?php echo $sttime; ?>" placeholder="起始时间" type="text">
                                            至
                                            
                                            <input class="form-control datepicker" onChange="$('#rankingform').submit();" id="endtime" name="endtime" readonly style="cursor:pointer; width:100px; display:inline;" value="<?php echo $edtime; ?>" placeholder="结束时间" type="text">--></div>
                                      
                    
                    
                    
                    
                    
                    
                    
                    
            
                    
                    
                    
                    
                    
                    
                    
                    
                    <a style="position:absolute; display:none; left:0; width:100%; border-radius:0; border-bottom:none; bottom:0; border-right:none; border-left:none;" class="btn btn-default" href="##">导出Excel >></a>
                
                </form>
                
                
                
                <h3 class="panel-title" style="padding:10px;">积分排名</h3>
                
                </header>
                <div class="panel-body">
                    <div id="ranking" class="" style="padding:0; height:400px; overflow-y:auto;"></div>
                    <div id="rankingpages" style="text-align:center;"></div>
                </div>
            </div> 
</div>
            







    
</div>




<style>
    #rankingpages ul{margin:0;}
</style>









</div>
  

  
  <div class="col-sm-12">
        <div style="height:400px; overflow:hidden;" class="panel" id="Ievent"><div class="panel-body"><form action="<?php echo U('Integral_log/index');?>" id="ajaxlistboxform" method="post" style="padding-bottom:15px;">
                <input type="hidden" name="order"/>
                <input type="hidden" name="pagesize" value="5" />
                <input type="hidden" name="order_type"/>
                <input type="hidden" name="pos_id" value="<?php echo $_GET['pos_id']; ?>">
                <input type ="hidden" name="formtype" value="">
                    
                    <html:dropdownselect class="typeselect1 pull-left" selected="" name="formtype" style="height:auto; width:120px; display:inline-block; line-height:32px; margin-right:10px;" multi="0" action="{:U('Team/form')}" title="选择规则"  placeholder="点击选择类型"  listloaded="" /><if condition="count($integraltype) gt 1">
            <select class="form-control pull-left" onChange="$('#ajaxlistboxform').submit();" name="type_id" style="display:inline; width:auto; margin-right:10px;">
            <volist name="integraltype" id="vo">
                <option value="{$vo.id}">{$vo.remark}</option>
            </volist>
            </select> 
                                <else/>
                                    <input type="hidden" name="type_id" value="{$integraltype.0.id}">
                                </if>
                                
                                
                                
                                
                                
                                
            
                                
                               
                                
                                 
                                
                                
                                
                   <div class="clearfix"></div>
            </form>
        
        
        
        
        <table class="display table table-bordered table-striped">
                    <thead>
                        <tr>
                    
                            <th>名字</th>
                            <th class="hidden-sm hidden-xs sortable" data-order="time" style="cursor:pointer;">时间 <i class="fa icon-sort"></i></th>
                            <th class="hidden-xs">部门</th>

                            <th style="width:60px">类型</th>
                            <th class="sortable" data-order="changenum" style="width:80px;cursor:pointer;">积分 <i class="fa icon-sort"></i></th>
                    
                            <th class="hidden-sm hidden-xs">审核人</th>
                            
                        </tr>
                    </thead>
                    <tbody class="" id="ajaxlistbox" style="color:#666;">
        
        
        
        
        
        </tbody>
                </table>
                <div class="PagesBox" id="ajaxlistboxpages" style="text-align:center"></div></div>
        
        
        
        
        <style>
		    #ajaxlistboxpages ul{margin-top:0;}
		</style>
        
        
        
        
        </div>
  </div>




</div>
  <script>
  
  $(".btn-group .datepicker").click(function(e) {
	event.stopPropagation();
});
$('.datepicker').datepicker({ dateFormat: 'yy-mm-dd' });

$('#ajaxlistbox').ajaxlist({loading:'<tr><td colspan="7"><div class="lockwindowlayout" id="lockwindowlayout" style="overflow:hidden; padding:10px 0;"><div class="loader-inner line-scale" style="text-align:center;"><div></div><div></div><div></div><div></div><div></div></div><style>.lockwindowlayout .line-scale{height:20px;}.lockwindowlayout .line-scale div{background:#5ec8ff; height:20px;}</style></div></td></tr>',success:function(){
	
	
	$('#ajaxlistbox tr').each(function(index, element) {
		//alert();
		$(this).find('td:eq(0)').remove(); 
        $(this).find('td:eq(3)').remove();
		$(this).find('td:eq(6)').remove();
    });
	 
	
	
}});
  
  $('.typeselect').blur(function(e) {
    $('#rankingform').submit();
});
$('#line-Chart').attr('width', $('#line-Chart').parent().width());
var cw = $('#line-Chart').parent().width();
	$("#lineChart").ajaxlist({success:function(data){
		$('#line-Chart').attr('width', cw);
		$('#line-Chart').attr('height', 250);
	
	}});
	 $('.integraltype2').change(function(){
        $('#lineChartform input[name="integralType"]').val($(this).val());
        $('#lineChartform').submit();
    });
	$(".btn-chart").click(function(e) {
        $('#lineChartform').find('.chartType').val($(this).val());
		$('#lineChartform').submit();
    });
	$('#ranking').ajaxlist({ success:function(){
	var niceScroll = $("#ranking").niceScroll({styler:"fb",cursorcolor:"#65cea7", cursorwidth: '3', cursorborderradius: '0px', background: '#424f63', spacebarenabled:false, cursorborder: '0'});
}});

$('.btn-group .btn.btn-default').each(function(index, element) {
        $(this).click(function(e) {
            $(this).parent().find('.btn.btn-default').removeClass('btn-success');
			$(this).addClass('btn-success');
        });
    });

	//$('#ranking').ajaxlist();
	$(window).trigger('load');
</script>